


#ifndef __server_base_tpImpl_h__
#define __server_base_tpImpl_h__

#include "server_base.h"

template<typename TClient,typename TServer>
BaseServerNetMgr<TClient,TServer>::BaseServerNetMgr()
{

}

template<typename TClient,typename TServer>
  BaseServerNetMgr<TClient,TServer>::~BaseServerNetMgr()
{
  
}

template<typename TClient,typename TServer>
bool  BaseServerNetMgr<TClient,TServer>::start()
{
  network_ = CreateNetwork();
  network_->accept(2356,BaseServerNetMgr::client_accept_callback
		   //boost::bind(&BaseServerNetMgr::client_accept_callback,this)
		   );
  return true;
}

template<typename TClient,typename TServer>
  bool  BaseServerNetMgr<TClient,TServer>::run()
{
  return true;
}

template<typename TClient,typename TServer>
  bool   BaseServerNetMgr<TClient,TServer>::stop()
{
  return true;
}

template<typename TClient,typename TServer>
  void BaseServerNetMgr<TClient,TServer>::client_accept_callback(Isocket* which_connect,bool& accept,bool& finishaccept)
{
  if(which_connect)
    {
      which_connect->start_async();
      TClient* t = new TClient(which_connect);
      t->OnConnect();
      TServer::clients_.push_back(t);
    }
}
































#endif __server_base_tpImpl_h__
